Control device for controlling a buffer memory

ABSTRACT

A control device is provided for controlling a buffer memory that can store n data words and is capable of being used for data transfer between a first system and a second system. The control device includes a write pointer and a read pointer. The control device also includes a write management circuit and a read management circuit. The write management circuit compares the content of the write pointer and the content of the read pointer, and authorizes or does not authorize a write operation in the memory. The read management circuit compares the content of the write pointer and the content of the read pointer, and authorizes or does not authorize a read operation in the memory.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is based upon and claims priority from French PatentApplication No. 06 03247, filed Apr. 13, 2006, the entire disclosure ofwhich is herein incorporated by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a control device for controlling abuffer memory that can store n data words and is capable of being usedfor data transfer between a first system and a second system, with thecontrol device including a write pointer and a read pointer.

2. Description of Related Art

The present invention is especially valuable in the case of twoelectronic systems exchanging data asynchronously or mesochronously. Thedata exchanged between two systems is said to be “asynchronous” if thetwo systems operate with clocks of different frequencies. A dataexchange is said to be “mesochronous” if the two systems operate withclocks that have the same frequency but are phase-shifted relative toeach other.

Many electronic circuits, integrated or otherwise, have independentsystems that operate at the rhythm of clock signals that have differentfrequencies and/or that are phase-shifted relative to each other. Thisis the case, for example, when a processor handles the data at a highfrequency and then transmits it to downstream circuits operating at alower frequency. This is also the case when two systems have their pacesset by the same clock signal generator, but with the first system beingat a greater distance from the clock signal generator (in terms oflength of the wire conveying the clock signal) than the second system,so that the clock signal received by the first system is phase-shiftedrelative to the clock signal received by the second system.

The transfer of data between two systems can be done, for example, usinga buffer memory.

FIG. 1 shows a circular buffer memory comprising one write-accessibleport and one read-accessible port. The memory has n storage registers R1to Rn, one input selection circuit, one output selection circuit, andone control device. The n storage registers store data words in transitbetween the first system and the second system. The input selectioncircuit comprises a data input connected to a data output of the firstsystem for receiving data to be transmitted, and n outputs eachconnected to one input of one of the n storage registers R1 to Rn. Theinput selection circuit also has a control input to receive a signalindicating the output to which the data input is to be connected. Theoutput selection circuit comprises n data inputs each connected to onedata output of the n registers R1 to Rn, one data output connected toone data input of the second system, and one control input. When thefirst system commands a write operation (WRITE signal) and/or when thesecond system commands a read operation (READ signal), the controldevice produces control signals WRITE_SELECT and/or READ_SELECT forwriting a piece of data to a register and/or reading a piece of datafrom a register, so that the pieces of data are read from the memory inthe order in which they were written.

The control device comprises a write pointer and a read pointer. Inpractice, these pointers are shift registers whose contents indicate thestorage registers, from among the storage registers R1 to Rn, in which anext word is to be written and a next word is to be read, respectively.The contents of the write pointer and the read pointer, respectively,are updated at each write operation and each read operation,respectively, in a register of the memory.

When the first system and the second system which use the buffer memorycommunicate asynchronously or mesochronously, phenomena of instability(commonly called “metastability”) may appear; the second system receivesa piece of data different from that transmitted by the first system whena data signal or command signal inside the memory or associated controldevice changes its state upon a command from the first system and doesnot have the time necessary to stabilize its value before beingexploited by the second system.

To prevent instability in the case of a transfer of data through aunique storage register whose rate is set by the clock of the firstsystem (i.e., the system which stores data in the storage register), oneelementary technique is the addition, at output of the storage register,of a synchronization circuit. This synchronization circuit is, forexample, a two-bit shift register whose rate is set according to theclock of the second system (i.e., the system that receives the datacontained in the storage register).

This technique introduces a latency of one to two clock cycles. Latencyis the time between the instant when a signal changes its state and theinstant when its value is stable and guaranteed. In the case of theaddition of a synchronization circuit, the latency of the control deviceis equal to the transit time in the synchronization circuit.

Other techniques are also used to prevent instabilities in buffermemories (such as FIFO memories), banks of registers, or dual-portmemories which are more complex than a simple register.

A first technique described in French Patent No. 2 849 228 or U.S.Patent Application No. 2004/0230723 uses a dual-flag mechanism (or“acknowledgment-due mechanism”) to ensure accurate reception of the databy the second system, and ghost registers (images of a pointer) toacquire a modification of the content of a pointer before it isexploited. Although the problem of the metastability of the data is wellresolved, one drawback of this technique is high latency, of about 2 to6 clock cycles. This is the time needed for the acknowledgment ofreception sent by the second system to be received by the first systemafter the updating and exploitation of the content of the ghostregisters.

A second technique described in U.S. Pat. No. 5,598,113 uses a controldevice comprising, as a complement, read and write pointers, one n-bitstate register (register 1150) updated according to the content of thewrite pointer and the read pointer (see, e.g., FIGS. 11 and 12 and theirassociated description). Each bit of the state register indicateswhether the same-ranking register of the buffer memory contains a dataword (that can be read by the second system) or if the register is empty(so that it can be written to by the first system).

The control device also has a write management circuit in which thesignals output from the state register (register 1150) are used todetermine whether the memory is full (circuit 1050 of D3) and the result(signal 1151) is synchronized (circuit 1135) before it is used (signal1115) to update the write pointer (1130). Also, the control devicecomprises a read management circuit in which the signals output from thestate register are synchronized (circuit 1160 of D3) with the clocksignal of the second system before being used to determine whether thememory is empty (circuit 1165), with the result (the signal 1175) beingthen used for the updating of the read pointer (1170).

One drawback of this technique is that it necessitates the use of astate register to manage the content of the memory. This increases thesilicon surface area of the control device. Furthermore, this stateregister is obtained by jam-type latch circuits. Such latch circuits aremore robust than D-type latch circuits or flip-flop circuits withrespect to the metastability phenomena that appear in systemscommunicating mesochronously.

SUMMARY OF THE INVENTION

It is an object of the present invention to overcome these drawbacks andto provide a device for controlling a buffer memory that can store ndata words and is capable of being used for data transfer between afirst system and a second system, with the control device comprising awrite pointer and a read pointer.

One embodiment of the present invention provides a control device forcontrolling a buffer memory that can store n data words and is capableof being used for data transfer between a first system and a secondsystem. The control device includes a write pointer comprising a first nbit shift register, a read pointer comprising a second n bit shiftregister, a write management circuit, and a read management circuit. Thefirst n bit shift register has a data input and a data output that areconnected together, a control input, and a clock input. The write-enablesignal, which is active when the memory is not full and the first systemcommands a write operation, is supplied to the control input of thefirst n bit shift register, and a first clock signal associated with thefirst system is supplied to the clock input of the first n bit shiftregister. The second n bit shift register has a data input and a dataoutput that are connected together, a control input, and a clock input.The read-enable signal, which is active when the memory is not empty andthe second system commands a read operation, is supplied to the controlinput of the second n bit shift register, and a second clock signalassociated with the second system is supplied to the clock input of thesecond n bit shift register. The first n bit shift register contains atleast two successive bits in a first logic state with the other bitsbeing in a second logic state, and the second n bit shift registercontains at least two successive bits in the first logic state with theother bits being in the second logic state. The write management circuitcompares the content of the write pointer and the content of the readpointer, and authorizes or does not authorize a write operation in thememory. The read management circuit compares the content of the writepointer and the content of the read pointer, and authorizes or does notauthorize a read operation in the memory.

Another embodiment of the present invention provides an electroniccircuit that includes such a control device. The electronic circuit alsoincludes a first system, a second system, and a buffer memory that isused for data transfer between the first system and the second system.The control device controls the buffer memory.

Other objects, features, and advantages of the present invention willbecome apparent from the following detailed description. It should beunderstood, however, that the detailed description and specificexamples, while indicating preferred embodiments of the presentinvention, are given by way of illustration only and variousmodifications may naturally be performed without deviating from thepresent invention.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a drawing of a conventional buffer memory,

FIG. 2 is a block diagram of a control device for controlling a buffermemory according to one embodiment of the present invention,

FIG. 3 shows a detailed view of the elements of the device of FIG. 2,and

FIGS. 4 and 5 are detailed views of exemplary alternative elements forthe device of FIG. 2.

DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS

Preferred embodiments of the present invention will be described indetail hereinbelow with reference to the attached drawings.

One preferred embodiment of the present invention provides a controldevice that includes a write management circuit and a read managementcircuit. The write management circuit compares the content of the writepointer and the content of the read pointer, and authorizes or does notauthorize a write operation in the memory. The read management circuitcompares the content of the write pointer and the content of the readpointer, and authorizes or does not authorize a read operation in thememory.

This control device does not use any state register. The writemanagement circuit and the read management circuit work directly onsignals coming from the write pointer and the read pointer. This limitsthe size of the device.

The write pointer of this embodiment is a first n-bit shift registerthat includes a data input and a data output that are connectedtogether, a control input, and a clock input. A write-enable signal,which is active when the memory is not full and the first systemcommands a write operation, is supplied to the control input, and afirst clock signal associated with the first system is supplied to theclock input. The first register contains at least two successive bits ina first logic state, with the other bits being in a second logic state.

The read pointer of this embodiment is a second n-bit shift registerthat includes a data input and a data output that are connectedtogether, a control input, and a clock input. A read-enable signal,which is active when the memory is not empty and the second systemcommands a read operation, is supplied to the control input, and asecond clock signal associated with the second system is supplied to theclock input. The second register contains at least two successive bitsin the first logic state, with the other bits being in the second logicstate.

Thus, in the write pointer, the position of the register in which thenext bit to be written is encoded by at least two successive bits (andnot only one bit as in the convention circuit) having a first logicvalue, with the other bits of the write pointer having a second logicvalue that is different from the first one. With this new encoding,during the updating of the write pointer at the time of a writeoperation, at least one of the two bits having a first value isunchanged as shall be seen below in the exemplary embodiments. Thus, ascompared with the conventional devices, the risk of metastability islimited, especially if the two systems using the control device exchangedata asynchronously. The same encoding is used in the read pointer inthe preferred embodiment.

In some embodiments, a first synchronization circuit is used in thewrite management circuit just as in the conventional circuit, and in theread management circuit a second synchronization circuit is used just asin the conventional circuit.

In an alternative embodiment, the second synchronization circuitcomprises an adjustable delay circuit for delaying the second clocksignal, and n D-type latch circuits or flip-flop circuits. Each of the nD-type latch circuits or flip-flop circuits comprises one data inputconnected to a data output of a same-ranking latch circuit of the writepointer, one clock input to which the second delayed clock signal issupplied, and one output. The outputs of the n D-type latch circuits orflip-flop circuits together form one parallel output at which thesynchronized signal representing the content of the write pointer isproduced.

Preferably, the delay circuit is adjustable. If necessary, andespecially when the first clock signal (associated with the firstsystem) and the second clock signal (associated with the second system)have the same frequency but are phase-shifted relative to each other,the delay circuit is adjusted so that the active edges of the delayedclock signal are sufficiently offset from the active edges of the firstclock signal and from the active edges of the second clock signal toensure that the signals are stabilized before being stored. Theadjustment of the delay circuit may be done, as the case may be, duringthe use of the control device or else during the manufacture and testingof the control device. The presence of a delay circuit considerablyreduces the phenomena of metastability that may arise.

Exemplary embodiments of the present invention will now be described indetail with reference to FIGS. 2-5.

FIG. 2 shows a control device for controlling a buffer memory accordingto one embodiment of the present invention. In this exemplaryembodiment, the control device is used to control a buffer memory, suchas buffer memory 1 of FIG. 1, that can store n data words and is capableof being used for a transfer of data between a first system and a secondsystem. The two systems can communicate synchronously, asynchronously,or mesochronously.

Like the known control devices, the control device of this exemplaryembodiment of the present invention comprises a write pointer 2 and aread pointer 3.

The write pointer 2 is formed by a first n-bit shift register 21comprising one D-type data input and one Q-type data output that areconnected together, one control input EN, and one clock input CK. Theshift register 21 has as many bits as there are registers that can beselected in the buffer memory. A write enable-signal ENABLE_W issupplied to the control input EN. This write-enable signal is activewhen the memory is not full and the first system commands a writeoperation WRITE. A first clock signal CLKW associated with the firstsystem is supplied to the clock input CK.

The read pointer 3 is formed by a second n-bit shift register 21comprising one D-type data input and one Q-type data output that areconnected together, one control input EN, and one clock input CK. Aread-enable signal ENABLE_R is supplied to the control input EN. Thisread-enable signal is active when the memory is not empty and the secondsystem commands a read operation READ. A second clock signal CLKRassociated with the first system is supplied to the clock input CK.

Like all shift registers, the register 21 is a set of series-connectedD-type latch circuits (n latch circuits for the register 21); the Q-typedata output of the last latch circuit forms a serial data output of theshift register and is connected to the D-type data input of the firstlatch circuit that forms the data input of the register. The Q-typeoutputs of each of the latches are connected together to a paralleloutput of the register, the clock inputs of all the latch circuits areconnected together to a clock input CK of the register, and the controlinputs of the latches are connected together to the control input EN ofthe register. The register 31 is formed in the same way as the register21.

According to this exemplary embodiment of the present invention, thewrite pointer contains two successive bits in a first logic state (inthis example, equal to “1”) and n−2 other bits in a second logic state(in this example, equal to “0”). The position of the two successive bitsin the first logic state indicates the rank of the register R1 to Rn inwhich the next piece of data is to be written. In the exemplaryembodiment shown in the figures, the first bit at “1” in the writepointer indicates the rank of the register to be written to (in thiscase R2). The content of the write pointer is shifted at each writeoperation in the buffer memory (with the signal ENABLE_W active).

For example, if initially the content of the write pointer is equal to:

1 1 0 0 . . . 0 (register to be written to =R1),

then, after updating following a write operation, the content of thepointer becomes:

0 1 1 0 . . . 0 (new register to be written to =R2).

The second bit, equal to “1”, does not change state at the updating ofthe pointer. Thus, there is no risk of metastability on this bit whenthe pointer is updated. The encoding of the information (thisinformation being the rank of the register to be written to) cantherefore be advantageously used when both systems that use the controldevice communicate asynchronously.

Similarly, the read pointer contains two successive bits in a firstlogic state (in this example, equal to “1”) and n−2 other bits in asecond logic state (in this example, equal to “0”). The position of thetwo successive bits in the first logic state indicates the rank of theregister R1 to Rn from which the next piece of data is to be read. Inparticular for the exemplary embodiment shown in the figures, the firstbit at “0” after the two bits at “1” in the read pointer indicates therank of the register to be read from (in this example R5, since the3^(rd) and 4^(th) bits of the read pointer are at “1”). The content ofthe read pointer is shifted at each read operation in the buffer memory(with the signal ENABLE_R active).

As a complement to the write pointer and read pointer, the controldevice of this embodiment of the present invention also comprises awrite management circuit 4, a read management circuit 5, and logic gates6 and 7. The write management circuit 4 compares the content of thewrite pointer and the content of the read pointer, and authorizes (withthe signal FULL inactive) or does not authorize an operation of writingto the memory. The read management circuit 5 compares the content of thewrite pointer and the content of the read pointer, and authorizes (withthe signal EMPTY inactive) or does not authorize an operation of readingthe memory.

The logic gate 6 combines the signal FULL, authorizing or notauthorizing a write operation, with a write command instruction WRITEreceived from the first system, and produces the write-enable signalENABLE_W that is supplied to the control input of the write pointer. Thelogic gate 7 combines the signal EMPTY, authorizing or not authorizing awrite operation with a read command instruction READ received from thesecond system, and produces the read-enable signal ENABLE_READ that issupplied to the control input of the write pointers.

The write management circuit 4 comprises a “memory full” detectioncircuit 41 that makes a bit-by-bit comparison of the content of thewrite pointer with the content of the read pointer, and produces asignal indicating that the memory is full (FULL signal) if a bit of theread pointer and a same-ranking bit of the write pointer aresimultaneously in the first logic state.

Because it directly uses the contents of the write pointer and the readpointer, the “memory full” detection circuit of this embodiment of thepresent invention is different from conventional circuits having thesame function. As shown in FIG. 3, the “memory full” detection circuit41 comprises n AND type logic gates 411_1 to 411 _(—) n with two inputsand one output, and one n+1−1^(th) logic gate 412. The AND type logicgate 411 _(—) i ranked i (with i ranging from 1 to n) comprises a firstinput connected to a data output of a latch circuit ranked i of thewrite pointer and one second input connected to a data output of a latchcircuit ranked i of the read pointer. The n+1−1^(th) logic gate 412comprises n inputs each connected to the output of one of the n AND typelogic gates, and one output at which the signal FULL is produced.

The write management circuit 4 also has a first synchronization circuit43 that synchronies the signal FULL, indicating that the memory is full,with the first clock signal CLKW.

The first synchronization circuit 43 has one data input to which thesignal FULL is supplied, one clock input to which the signal CLKW issupplied, and one data output at which the synchronized signal isproduced.

In the example shown in FIG. 3, the first synchronization circuit 43 isa two-bit register having two series-connected D latch circuits 431 and432.

One alternative embodiment of the present invention uses the firstsynchronization circuit shown in FIG. 5. This first synchronizationcircuit 44 comprises synchronization means to synchronize the signalproduced by the “memory full” detection circuit 41 with the first clocksignal CLKW, and delay means to delay the furnishing of the synchronizedsignal if the write control signal (WRITE) and the synchronized signalhad been inactive during a previous active edge of the first clocksignal.

Delaying the supply of the synchronized signal optimizes the content ofthe memory. That is, it provides for the most efficient use of theregisters R1 to Rn, taking into account the fact that there is a delayof one to two clock CLKW cycles for the updating of the signal FULL. Forthis purpose, when the output signal from the synchronization means isactive, a check is made to see whether, during the previous clock cycleCLKW, the memory had been full (i.e., whether the output from thesynchronization means had been inactive) or whether one write operationhad been performed (i.e., if the signal WRITE had been active). In thiscase, the memory is considered to be really full and the delay meansproduces the active signal FULL to prohibit an additional writeoperation.

If, however, during the previous clock signal CLKW, the memory had notbeen full (with output of the synchronization means inactive) and if awrite operation had not been performed (with WRITE inactive at thepreceding cycle), then yet another piece of data can be written to thememory and the delay means produces the inactive signal FULL toauthorize an additional write operation.

In FIG. 5, the synchronization means includes, as in the case ofsynchronization circuit 43, a two-bit register having twoseries-associated D latch circuits 441 a and 442. The input of the latchcircuit 441 is connected to the output of the detector circuit 41.

The delay means of FIG. 5 includes an OR type gate 443, a D-type latchcircuit 444, and an AND type gate 445. The OR type gate 443 comprisesone input connected to the output of the latch circuit 442, one input towhich the write control signal WRITE is supplied, and one output. TheD-type latch circuit 444 comprises one data input connected to theoutput of the gate 443, one control input to which the first clocksignal CLKW is supplied, and one output. The AND type gate 445 comprisesone input connected to the output of the latch circuit 442, one inputconnected to the output of the latch circuit 444, and one output atwhich the signal FULL is produced.

The gate 443 and the latch circuit 444 store the state of the signalWRITE and the signal output from the two-bit register during theprevious clock signal CLKW active edge. The gate 445 combines the stateof the signal output from the two-bit register and the informationstored by the latch circuit 444.

The read management circuit 5 comprises a decoding circuit 51, a secondsynchronization circuit 52, and a “memory empty” detection circuit 53.The decoding circuit 51 produces a read selection signal READ_SELECTaccording to the content of the read pointer, and the secondsynchronization circuit 52 produces a signal representing the content ofthe read pointer synchronized with the second clock signal CLKR. The“memory empty” detection circuit 53 compares the synchronized signalrepresenting the content of the write pointer and the read selectionsignal, and produces a signal EMPTY indicating that the memory is empty(this signal being active or not active according to the result of thecomparison).

Depending on the content of the read pointer, the decoding circuit 51produces an n-bit READ_SELECT signal comprising one bit in the firstlogic state (“1”) and n−1 bits in the second logic state (“0”). The rankof the bit in the first logic state corresponds to the rank of theregister R1 to Rn of the memory from which the next piece of data is tobe read. The signal READ_SELECT can be supplied directly as a controlsignal to the input selection circuit of the buffer memory.

The decoding circuit 51 of this exemplary embodiment is formed by n ANDtype logic gates 511_1 to 511 _(—) n with two inputs and one output. Then-ranking logic gate 511 _(—) n has a first input connected to the dataoutput of the n-ranking latch of the read pointer 31 and a second inputconnected to the data output of the first-ranking latch of the readpointer 31. A logic gate 511 _(—) i ranked (with i ranging from 1 ton−1) comprises a first input connected to a data output of a latchcircuit ranked i of the read pointer 31 and a second input connected toa data output of a latch ranked i+1 of the read pointer 31. The one-bitdata outputs of each of the gates 511_1 to 511 _(—) n are connectedtogether as the parallel data output of the circuit 51.

In the exemplary embodiment of FIG. 3, the “empty memory” detectioncircuit 53 comprises n AND type logic gates 531_1 to 531 _(—) n and ann+1−i^(th) logic gate. The n AND type logic gates 531_1 to 531 _(—) nhave two non-inverting data inputs, one inverting data input, and oneoutput. The n+1−i^(th) logic gate 532 comprises n inputs each connectedto an output of one of the n logic gates, and one output at which thesignal EMPTY indicating that the memory is empty is produced.

The logic gate 531_1 ranked 1 comprises one non-inverting inputconnected to the wire ranked 1 of the parallel output of the readdecoder, one inverting input connected to the wire ranked 2 of theparallel output of the second synchronization circuit 52, onenon-inverting input connected to the wire ranked 3 of the paralleloutput of the second synchronization circuit 52, and one output.

The logic gate 531_2 ranked 2 comprises one non-inverting inputconnected to the wire ranked 2 of the parallel output of the readdecoder, one inverting input connected to the wire ranked 3 of theparallel output of the second synchronization circuit 52, onenon-inverting input connected to the wire ranked 4 of the paralleloutput of the second synchronization circuit 52, and one output.

The logic gate 531 _(—) i ranked i (with i ranging from 3 to n−2) hasone non-inverting input connected to the i ranking wire of the paralleloutput of the read decoder, one inverting input connected to the i+1ranking wire of the parallel output of the second synchronizationcircuit 52, one non-inverting input connected to the i+1 ranking wire ofthe parallel output of the second synchronization circuit 52, and oneoutput.

The logic gate 531 _(—) n−1 ranked n−1 has one non-inverting inputconnected to the n−1 ranking wire of the parallel output of the readdecoder, one inverting input connected to the n ranking wire of theparallel output of the second synchronization circuit 52, onenon-inverting input connected to the wire ranked 1 of the paralleloutput of the second synchronization circuit 52, and one output.

The logic gate 531 _(—) n ranked n has one non-inverting input connectedto the n ranking wire of the parallel output of the read decoder, oneinverting input connected to the wire ranked 1 of the parallel output ofthe second synchronization circuit 52, one non-inverting input connectedto the wire ranked 2 of the parallel output of the secondsynchronization circuit 52, and one output.

In the exemplary embodiment of FIG. 3, the second synchronizationcircuit 52 comprises n two-bit registers 521_1 to 521 _(—) n. The nregisters 521_1 to 521 _(—) n are identical to the first synchronizationcircuit 43 as described in detail above (i.e., two series-associatedlatch circuits). Each of them comprises a data input connected to a dataoutput of a same-ranking latch circuit of the write pointer 21, a clockinput to which the second clock signal CLKR is supplied, and an output.

The outputs of all the registers 521_1 to 521 _(—) n together form aparallel output at which the synchronized signal representing thecontent of the write pointer is produced.

In the exemplary control device shown in FIG. 3, the secondsynchronization circuit 52 introduces a latency of ΔCLKA+1 cycles of theclock signal CLKR, corresponding to the time of transit of the contentof the write pointer in the second synchronization circuit 52. ΔCLKA isthe time between the active edge of the clock signal CLKW and the activeedge of the clock signal CLKR at the time of the synchronization. ΔCLKAranges from 0 to 1 cycle of the signal CLKR. The total latency of thecontrol device of this embodiment of the present invention is then equalto ΔCLKA+2*TR, ranging from 2*TR to 3*TR: an inevitable latency of onecycle, corresponding to the time of updating the registers plus onesynchronization latency of one to two cycles.

In an alternative embodiment of the present invention, the secondsynchronization circuit 52 of FIG. 3 is replaced by the secondsynchronization circuit 54 of FIG. 4. The second synchronization circuit54 includes an adjustable delay circuit 541 for delaying the secondclock signal CLKR, and n D-type latches 542_1 to 542 _(—) n. Each of theD-type latches comprises a data input connected to a data output of asame-ranking latch of the write pointer, a clock input to which thedelayed second clock signal CLKR is supplied, and an output. The outputsof the n D-type latches together form a parallel output at which thereis produced the synchronized signal representing the content of thewrite pointer and supplied to the parallel input of the detectioncircuit 53.

In this alternative embodiment, the second synchronization circuit hasonly one series of D-type latch circuits (instead of two as in circuit52). The latency introduced by the synchronization circuit is thusreduced to 0 to 1 cycle and the total latency of the device is reducedto 1 to 2 cycles. Furthermore, the use of the adjustable delay greatlyreduces the risk of metastability should the data exchanges between thetwo systems be done mesochronously.

Other alternative embodiments of the device of FIG. 3 can be envisagedwithin the framework of the present invention.

A feature of embodiments of the present invention is the encoding of thepositions of the registers of the memory to be written to and read from,respectively, in the write pointer and the read pointer, respectively.This encoding makes the device robust with respect to cases ofmetastability that could appear if the device is used for anasynchronous or mesochronous transfer of data between two systems.

In the exemplary device described in detail with respect to FIG. 3, thefollowing encoding is used:

two bits at “1” and n−2 other bits at “0”,

the rank of the first bit at “1” in the write pointer corresponds to therank of the register to be written to, and

the rank of the first bit at “0” after the two bits at “1” in the readpointer corresponds to the rank of the register to be read from.

More generally, within the framework of the present invention, theposition of the register R1 to Rn of the memory to be written to or readfrom can be encoded in the write pointer and/or in the read pointer sothat, at an updating of the write pointer or read pointer (correspondingto a one-bit shift in a shift register), the value of the bit of thepointer associated with the new register to be written to or to be readfrom does not change during the updating. This averts any risk ofmetastability on this bit.

This condition is verified as soon as, in a pointer:

at least two successive bits are in a first logic state (“1” or “0”),and the other bits are in a second logic state (“0” or “1”), and

the rank of the register to be written to or to be read from is definedwith respect to these at least two bits.

It is thus possible to envisage an alternative encoding such that, in awrite pointer or read pointer:

three successive bits are at “0” and n−3 other bits are at “1”,

the rank of the first bit at “0” in the write pointer corresponds to therank of the register to be written to, and

the rank of the first bit at “1” after the three bits at “1” in the readpointer corresponds to the rank of the register to be read from.

Naturally, depending on the encoding chosen, the logic circuits of thecontrol device would be adapted accordingly. This would be the caseespecially for:

the write management circuit, and more particularly the “memory full”detection circuit (it must verify, from the content of the write pointerand the content of the read pointer, that there remains at least oneempty register in the memory to authorize a write operation ifnecessary), and

the read management circuit, and more particularly the read decoder andthe “memory empty” detection circuit (it must verify, from the contentof the write pointer and the content of the read pointer, that thereremains at least one non-empty register in the memory to authorize aread operation if necessary).

Because the exemplary embodiment of the present invention uses aparticular encoding, the control device also has a write decoder 8 forproducing, from the content of the write pointer, a write selectionsignal WRITE_SELECT for controlling the input selection circuit. Then-bit WRITE_SELECT signal has only one active bit, the rank of whichcorresponds to the rank of the register to be written to in the memory.In the example of FIG. 3, the write decoder has n AND type logic gates81_1 to 81 _(—) n. The logic gate ranked i (with i ranging from 1 ton−1) comprises a data output and two data inputs respectively connectedto the output of a latch of the same rank i and to the output of a latchranked i+1 of the write pointer 21. The logic gate ranked n comprises adata output and two data inputs respectively connected to the output ofthe latch ranked n and to the output of the latch ranked 1 of the writepointer 21.

The data outputs of all the gates 81_1 to 81-_(—) n are connectedtogether to form a parallel output of the decoder 8 at which the signalWRITE_SELECT is produced.

As for the read selection signal READ_SELECT necessary to control theoutput selection circuit of the memory, it is produced by the readmanagement circuit 5, and more specifically by the decoding circuit 51of the read management circuit 5.

While there has been illustrated and described what are presentlyconsidered to be the preferred embodiments of the present invention, itwill be understood by those skilled in the art that various othermodifications may be made, and equivalents may be substituted, withoutdeparting from the true scope of the present invention. Additionally,many modifications may be made to adapt a particular situation to theteachings of the present invention without departing from the centralinventive concept described herein. Furthermore, an embodiment of thepresent invention may not include all of the features described above.Therefore, it is intended that the present invention not be limited tothe particular embodiments disclosed, but that the invention include allembodiments falling within the scope of the appended claims.

1. A control device for controlling a buffer memory that can store ndata words and is capable of being used for data transfer between afirst system and a second system, the control device comprising: a writepointer comprising a first n-bit shift register, wherein: the firstn-bit shift register comprises a data input and a data output that areconnected together, a control input, and a clock input, a write-enablesignal, which is active when the memory is not full and the first systemcommands a write operation, is supplied to the control input of thefirst n-bit shift register, a first clock signal associated with thefirst system is supplied to the clock input of the first n-bit shiftregister, and the first n-bit shift register contains at least twosuccessive bits in a first logic state, with the other bits being in asecond logic state; a read pointer comprising a second n-bit shiftregister, wherein: the second n-bit shift register comprises a datainput and a data output that are connected together, a control input,and a clock input, a read-enable signal, which is active when the memoryis not empty and the second system commands a read operation, issupplied to the control input of the second n-bit shift register, asecond clock signal associated with the second system is supplied to theclock input of the second n-bit shift register, and the second n-bitshift register contains at least two successive bits in the first logicstate, with the other bits being in the second logic state; a writemanagement circuit for comparing content of the write pointer andcontent of the read pointer, and authorizing or not authorizing a writeoperation in the memory; and a read management circuit for comparing thecontent of the write pointer and the content of the read pointer, andauthorizing or not authorizing a read operation in the memory.
 2. Thecontrol device according to the claim 1, wherein the write managementcircuit comprises a “memory full” detection circuit for making abit-by-bit comparison of the content of the write pointer with thecontent of the read pointer, and producing a signal indicating that thememory is full if a bit of the read pointer and a same-ranking bit ofthe write pointer are simultaneously in the first logic state.
 3. Thecontrol device according to claim 2, wherein the “memory full” detectioncircuit comprises: n AND type logic gates, with the logic gate ranked i,with i ranging from 1 to n, comprising a first input connected to a dataoutput of a latch circuit ranked i of the write pointer, a second inputconnected to a data output of a latch circuit ranked i of the readpointer, and an output; and one n+1−1^(th) logic gate comprising ninputs that each are connected to the output of one of the n AND typelogic gates, and an output at which the signal indicating that thememory is full is produced.
 4. The control device according to claim 2,wherein the write management circuit further comprises a firstsynchronization circuit for synchronizing the signal indicating that thememory is full with the first clock signal.
 5. The control deviceaccording to claim 4, wherein the first synchronization circuit delaysfurnishing of the synchronized signal if the write control signal andthe synchronized signal had been inactive during a previous active edgeof the first clock signal.
 6. The control device according claim 2,wherein the read management circuit comprises: a decoding circuit forproducing a read selection signal based on the content of the readpointer; a second synchronization circuit for producing a signalrepresenting the content of the read pointer synchronized with thesecond clock signal; and a “memory empty” detection circuit forcomparing the synchronized signal representing the content of the writepointer and the read selection signal, and producing a signal indicatingthat the memory is empty, which is active or not active according to aresult of the comparison.
 7. The control device according claim 1,wherein the read management circuit comprises: a decoding circuit forproducing a read selection signal based on the content of the readpointer; a second synchronization circuit for producing a signalrepresenting the content of the read pointer synchronized with thesecond clock signal; and a “memory empty” detection circuit forcomparing the synchronized signal representing the content of the writepointer and the read selection signal, and producing a signal indicatingthat the memory is empty, which is active or not active according to aresult of the comparison.
 8. The control device according to claim 7,wherein the “memory empty” detection circuit comprises: n logic gates,with the logic gate ranked i, with i ranging from 3 to n−2, comprising anon-inverting input connected to a wire ranked i of the parallel outputof the read decoder, an inverting input connected to a wire ranked i+1of the parallel output of the second synchronization circuit, anon-inverting input connected to a wire ranked i+2 of the paralleloutput of the second synchronization circuit 52, and an output; and onen+1−1^(th) logic gate comprising n inputs that each are connected to theoutput of one of the n logic gates, and an output at which the signalindicating that the memory is empty is produced.
 9. The control deviceaccording to claim 7, wherein the second synchronization circuitcomprises n two-bit registers, each of the n two-bit registerscomprising: a data input connected to a data output of a same-rankinglatch circuit of the write pointer; a clock input to which the secondclock signal is supplied; and an output, the outputs of all n two-bitregisters together forming a parallel output at which the synchronizedsignal representing the content of the write pointer is produced. 10.The control device according to claim 7, wherein the secondsynchronization circuit comprises: an adjustable delay circuit fordelaying the second clock signal; and n D-type latch circuits, whereineach of the D-type latch circuits comprises: one data input connected toa data output of a same-ranking latch circuit of the write pointer; oneclock input to which the second delayed clock signal is supplied; andone output, the outputs of the n D-type latch circuits together formingone parallel output at which the synchronized signal representing thecontent of the write pointer is produced.
 11. The control deviceaccording to claim 1, wherein the first clock signal and the secondclock signal have either different frequencies, or have the samefrequency but are phase-shifted relative to each other.
 12. Anelectronic circuit comprising: a first system; a second system; a buffermemory that can store n data words, the buffer memory being used fordata transfer between the first system and the second system; and acontrol device for controlling the buffer memory, the control deviceincluding: a write pointer comprising a first n-bit shift register,wherein: the first n-bit shift register comprises a data input and adata output that are connected together, a control input, and a clockinput, a write-enable signal, which is active when the memory is notfull and the first system commands a write operation, is supplied to thecontrol input of the first n-bit shift register, a first clock signalassociated with the first system is supplied to the clock input of thefirst n-bit shift register, and the first n-bit shift register containsat least two successive bits in a first logic state, with the other bitsbeing in a second logic state; a read pointer comprising a second n-bitshift register, wherein: the second n-bit shift register comprises adata input and a data output that are connected together, a controlinput, and a clock input, a read-enable signal, which is active when thememory is not empty and the second system commands a read operation, issupplied to the control input of the second n-bit shift register, asecond clock signal associated with the second system is supplied to theclock input of the second n-bit shift register, and the second n-bitshift register contains at least two successive bits in the first logicstate, with the other bits being in the second logic state; a writemanagement circuit for comparing content of the write pointer andcontent of the read pointer, and authorizing or not authorizing a writeoperation in the memory; and a read management circuit for comparing thecontent of the write pointer and the content of the read pointer, andauthorizing or not authorizing a read operation in the memory.
 13. Theelectronic circuit according to the claim 12, wherein the writemanagement circuit of the control device comprises a “memory full”detection circuit for making a bit-by-bit comparison of the content ofthe write pointer with the content of the read pointer, and producing asignal indicating that the memory is full if a bit of the read pointerand a same-ranking bit of the write pointer are simultaneously in thefirst logic state.
 14. The electronic circuit according to claim 13,wherein the “memory full” detection circuit of the write managementcircuit of the control device comprises: n AND type logic gates, withthe logic gate ranked i, with i ranging from 1 to n, comprising a firstinput connected to a data output of a latch circuit ranked i of thewrite pointer, a second input connected to a data output of a latchcircuit ranked i of the read pointer, and an output; and one n+1−1^(th)logic gate comprising n inputs that each are connected to the output ofone of the n AND type logic gates, and an output at which the signalindicating that the memory is full is produced.
 15. The electroniccircuit according claim 13, wherein the read management circuit of thecontrol device comprises: a decoding circuit for producing a readselection signal based on the content of the read pointer; a secondsynchronization circuit for producing a signal representing the contentof the read pointer synchronized with the second clock signal; and a“memory empty” detection circuit for comparing the synchronized signalrepresenting the content of the write pointer and the read selectionsignal, and producing a signal indicating that the memory is empty,which is active or not active according to a result of the comparison.16. The electronic circuit according claim 12, wherein the readmanagement circuit of the control device comprises: a decoding circuitfor producing a read selection signal based on the content of the readpointer; a second synchronization circuit for producing a signalrepresenting the content of the read pointer synchronized with thesecond clock signal; and a “memory empty” detection circuit forcomparing the synchronized signal representing the content of the writepointer and the read selection signal, and producing a signal indicatingthat the memory is empty, which is active or not active according to aresult of the comparison.
 17. The electronic circuit according to claim16, wherein the “memory empty” detection circuit of the read managementcircuit of the control device comprises: n logic gates, with the logicgate ranked i, with i ranging from 3 to n−2, comprising a non-invertinginput connected to a wire ranked i of the parallel output of the readdecoder, an inverting input connected to a wire ranked i+1 of theparallel output of the second synchronization circuit, a non-invertinginput connected to a wire ranked i+2 of the parallel output of thesecond synchronization circuit 52, and an output; and one n+1−i^(th)logic gate comprising n inputs that each are connected to the output ofone of the n logic gates, and an output at which the signal indicatingthat the memory is empty is produced.
 18. The electronic circuitaccording to claim 16, wherein the second synchronization circuit of theread management circuit of the control device comprises n two-bitregisters, each of the n two-bit registers comprising: a data inputconnected to a data output of a same-ranking latch circuit of the writepointer; a clock input to which the second clock signal is supplied; andan output, the outputs of all n two-bit registers together forming aparallel output at which the synchronized signal representing thecontent of the write pointer is produced.
 19. The electronic circuitaccording to claim 16, wherein the second synchronization circuit of theread management circuit of the control device comprises: an adjustabledelay circuit for delaying the second clock signal; and n D-type latchcircuits, wherein each of the D-type latch circuits comprises: one datainput connected to a data output of a same-ranking latch circuit of thewrite pointer; one clock input to which the second delayed clock signalis supplied; and one output, the outputs of the n D-type latch circuitstogether forming one parallel output at which the synchronized signalrepresenting the content of the write pointer is produced.
 20. Theelectronic circuit according to claim 12, wherein the first clock signaland the second clock signal have either different frequencies, or havethe same frequency but are phase-shifted relative to each other.